import request from '@/utils/request'

// api地址
const api = {
  region:"/bms/yoshopRegion/tree",
  add: '/ums/yoshopUserAddress/create',
  list:'/ums/yoshopUserAddress/list',
  delete:'/ums/yoshopUserAddress/delete',
  deta:'/ums/yoshopUserAddress/getDetailsByID',
  point:'/sms/yoshopSelfPoint/listAll'
}

// 用户收货地址添加
export const add = (data) => {
  return request.post(api.add,data)
}

// 用户收货地址列表
export const list = (params) => {
  return request.get(api.list,params,{ load: true })
}
// 用户收货地详情
export const deta = (param) => {
  let params=`?id=${param.id}`;
  return request.post(api.deta+params)
}

// 用户收货地址删除
export const del = (param) => {
  let params=`?ids=${param.ids}`;
  return request.post(api.delete+params)
}
// 自提点列表
export const pointList = () => {
  return request.get(api.point,{ load: true })
}
// 自提点列表
export const region = () => {
  return request.get(api.region,{ load: true })
}
